﻿using AiXiu.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AiXiu.IDAL
{
    public interface IUserService
    {
        /// <summary>
        /// 通过用户名查找
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        bool IsSanmeUserName(string userName);

        /// <summary>
        /// 通过手机号查找
        /// </summary>
        /// <param name="mobile">手机号</param>
        /// <returns></returns>
        bool IsSanmeMobile(string mobile);

        /// <summary>
        /// 注册方法
        /// </summary>
        /// <param name="tBLogins"></param>
        /// <returns></returns>
        bool AddUser(TBLogins tBLogins);

        /// <summary>
        /// 通过用户名查找用户信息
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        TBLogins FindByUserName(string userName);

        /// <summary>
        /// 通过用户编号(id)查找
        /// </summary>
        /// <param name="userId">编号</param>
        /// <returns></returns>
        TBUsers FindByUserId(int userId);

        /// <summary>
        /// 通过用户手机号查找
        /// </summary>
        /// <param name="Mobile">手机号</param>
        /// <returns></returns>
        TBLogins FindByMobile(string Mobile);

        /// <summary>
        /// 更新用户信息（不包含头像）
        /// </summary>
        /// <param name="profile"></param>
        /// <returns></returns>
        TBUsers EditwithoutAvatar(TBUsers profile);

        /// <summary>
        /// 更新用户头像
        /// </summary>
        /// <param name="profile"></param>
        /// <returns></returns>
        TBUsers EditAvatar(TBUsers profile);

        /// <summary>
        /// 上传视频信息
        /// </summary>
        /// <param name="upload"></param>
        /// <returns></returns>
        TBVideos TOBeUpload(string videoId, int userId, string headline, string location = null);

        /// <summary>
        /// 获取处理中的视频Id列表
        /// </summary>
        /// <returns></returns>
        List<string> GetInProcessVideoIds();

        /// <summary>
        /// 批量更新视频信息
        /// </summary>
        /// <param name="videoInfos">要更新的视频列表</param>
        void UpdateVideos(List<VideoInfo> videoInfos);

        /// <summary>
        /// 通过用户id获取视频列表
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <returns></returns>
        List<TBVideos> GetTBVideosByUserId(int userId);

        /// <summary>
        /// 根据视频id删除视频
        /// </summary>
        /// <param name="videoid">视频id</param>
        void DeleteVideo(string videoid);                           

        /// <summary>
        /// 查询可播放视频列表
        /// </summary>
        /// <returns></returns>
        List<TBVideos> GetVideos();

        /// <summary>
        /// 通过视频id获取视频信息
        /// </summary>
        /// <param name="videoId">视频id</param>
        /// <returns>本地数据库视频信息</returns>
        TBVideos GetVideoByVideoId(string videoId);

        /// <summary>
        /// 获取视频播放凭证
        /// </summary>
        /// <param name="videoId">视频id</param>
        /// <returns>阿里云视频信息</returns>
        GetPlayInfoResult GetPlayInfo(string videoId);
    }

}
